﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Percolation.Gui
{
    [Serializable]
    class Experiment
    {
        public NetInterface Net { get; private set; }
        public BoltStatistics BoltStats { get; private set; }
        public HKStatistics HKStats { get; private set; }

        public Experiment(NetInterface net)
        {
            Net = net;
            BoltStats = null;
            HKStats = null;
        }

        public void addBoltStatistics(BoltStatistics stats)
        {
            BoltStats = stats;
        }

        public void addHKStatistics(HKStatistics stats)
        {
            HKStats = stats;
        }
    }

    [Serializable]
    class ExperimentsPack
    {
        public ExperimentsPack(NetPackSettings settings)
        {
            Settings = settings;
            Experiments = new List<Experiment>();
            Initialize();
        }

        public List<Experiment> Experiments { get; private set; }
        public NetPackSettings Settings { get; private set; }

        private void Initialize()
        {
            int count = 1;
            if (Settings.NetType == NetTypeEnum.Random || Settings.NetType == NetTypeEnum.VerGradient
                || Settings.NetType == NetTypeEnum.HorGradient)
                count = Settings.Count;

            NetParams netParams = Settings.getNetParams();
            for (int i = 0; i < count; ++i)
                Experiments.Add(new Experiment(NetGenerator.generate(netParams)));
        }
    }

}
